package com.aaa.pojo;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

@Data
public class User implements UserDetails {
    private Integer id;
    private String username;
    private String password;
    private String headPicture;
    private Integer roleId;

    private Collection<? extends GrantedAuthority> authorities;

    // 账户是否没有过期
    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    // 账户是否没有锁定
    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    //密码是否没有过期
    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    //账户是否可用
    @Override
    public boolean isEnabled() {
        return true;
    }
}
